package com.zxy.dao.hibimpl;

import java.util.HashMap;
import java.util.List;

import com.zxy.dao.UsersDao;
import com.zxy.entity.Users;

public class UsersDaoHibImp extends BaseHibDao implements UsersDao {

	@Override
	public Users getByName(String name) {
		if (name == null || "".equals(name)) {
			return null;
		}
		String hql = "from Users u where u.name = :name";
		HashMap<String, Object> map = new HashMap<String, Object>();
		map.put("name", name);
		Users user = (Users) super.get(Users.class, 1);
		return user;
		// List<Users> list = search(hql, map);
		// if (list == null || list.size() <= 1) {
		// return null;
		// }
		// return list.get(0);
	}

}
